import { IDataWithError } from '@/service/typing/service-typing'
import { IUpdateUserInfoParam, IUserInfo, IUserService } from '@/service/typing/service/IUserService'
import { HttpTransfer } from '../transfer/transfer'
import { IUserURL } from '../transfer/urls/user-url'

export class UserService implements IUserService {
  constructor(private readonly http: HttpTransfer, private readonly urls: IUserURL) {}
  getUserInfo(): Promise<IDataWithError<IUserInfo, any>> {
    return this.http.request(this.urls.getUserInfo)
  }
  updateUserInfo(param: IUpdateUserInfoParam): Promise<IDataWithError<any, any>> {
    return this.http.request(this.urls.updateUserInfo, param)
  }
}
